Optimal. Leaf size=153 \[ \frac {(2 A-i B) x}{8 a^3 c}+\frac {A+i B}{12 a^3 c f (i-\tan (e+f x))^3}-\frac {i A}{8 a^3 c f (i-\tan (e+f x))^2}-\frac {3 A-i B}{16 a^3 c f (i-\tan (e+f x))}+\frac {A-i B}{16 a^3 c f (i+\tan (e+f x))} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.15, antiderivative size = 153, normalized size of antiderivative = 1.00, number of steps
used = 4, number of rules used = 3, integrand size = 41, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.073, Rules used = {3669, 78, 209}
\begin {gather*} -\frac {3 A-i B}{16 a^3 c f (-\tan (e+f x)+i)}+\frac {A-i B}{16 a^3 c f (\tan (e+f x)+i)}+\frac {A+i B}{12 a^3 c f (-\tan (e+f x)+i)^3}+\frac {x (2 A-i B)}{8 a^3 c}-\frac {i A}{8 a^3 c f (-\tan (e+f x)+i)^2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 78
Rule 209
Rule 3669
Rubi steps
\begin {align*} \int \frac {A+B \tan (e+f x)}{(a+i a \tan (e+f x))^3 (c-i c \tan (e+f x))} \, dx &=\frac {(a c) \text {Subst}\left (\int \frac {A+B x}{(a+i a x)^4 (c-i c x)^2} \, dx,x,\tan (e+f x)\right )}{f}\\ &=\frac {(a c) \text {Subst}\left (\int \left (\frac {A+i B}{4 a^4 c^2 (-i+x)^4}+\frac {i A}{4 a^4 c^2 (-i+x)^3}+\frac {-3 A+i B}{16 a^4 c^2 (-i+x)^2}+\frac {-A+i B}{16 a^4 c^2 (i+x)^2}+\frac {2 A-i B}{8 a^4 c^2 \left (1+x^2\right )}\right ) \, dx,x,\tan (e+f x)\right )}{f}\\ &=\frac {A+i B}{12 a^3 c f (i-\tan (e+f x))^3}-\frac {i A}{8 a^3 c f (i-\tan (e+f x))^2}-\frac {3 A-i B}{16 a^3 c f (i-\tan (e+f x))}+\frac {A-i B}{16 a^3 c f (i+\tan (e+f x))}+\frac {(2 A-i B) \text {Subst}\left (\int \frac {1}{1+x^2} \, dx,x,\tan (e+f x)\right )}{8 a^3 c f}\\ &=\frac {(2 A-i B) x}{8 a^3 c}+\frac {A+i B}{12 a^3 c f (i-\tan (e+f x))^3}-\frac {i A}{8 a^3 c f (i-\tan (e+f x))^2}-\frac {3 A-i B}{16 a^3 c f (i-\tan (e+f x))}+\frac {A-i B}{16 a^3 c f (i+\tan (e+f x))}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.98, size = 164, normalized size = 1.07 \begin {gather*} -\frac {\sec ^2(e+f x) (18 i A+3 (B (-1-4 i f x)+A (2 i+8 f x)) \cos (2 (e+f x))+(-2 i A-4 B) \cos (4 (e+f x))+6 A \sin (2 (e+f x))+3 i B \sin (2 (e+f x))+24 i A f x \sin (2 (e+f x))+12 B f x \sin (2 (e+f x))+4 A \sin (4 (e+f x))-2 i B \sin (4 (e+f x)))}{96 a^3 c f (-i+\tan (e+f x))^2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.31, size = 128, normalized size = 0.84
method | result | size |
derivativedivides | \(\frac {-\frac {i A}{8 \left (-i+\tan \left (f x +e \right )\right )^{2}}-\frac {-\frac {3 A}{16}+\frac {i B}{16}}{-i+\tan \left (f x +e \right )}-\frac {\frac {A}{4}+\frac {i B}{4}}{3 \left (-i+\tan \left (f x +e \right )\right )^{3}}+\left (-\frac {B}{16}-\frac {i A}{8}\right ) \ln \left (-i+\tan \left (f x +e \right )\right )-\frac {-\frac {A}{16}+\frac {i B}{16}}{i+\tan \left (f x +e \right )}+\left (\frac {B}{16}+\frac {i A}{8}\right ) \ln \left (i+\tan \left (f x +e \right )\right )}{f \,a^{3} c}\) | \(128\) |
default | \(\frac {-\frac {i A}{8 \left (-i+\tan \left (f x +e \right )\right )^{2}}-\frac {-\frac {3 A}{16}+\frac {i B}{16}}{-i+\tan \left (f x +e \right )}-\frac {\frac {A}{4}+\frac {i B}{4}}{3 \left (-i+\tan \left (f x +e \right )\right )^{3}}+\left (-\frac {B}{16}-\frac {i A}{8}\right ) \ln \left (-i+\tan \left (f x +e \right )\right )-\frac {-\frac {A}{16}+\frac {i B}{16}}{i+\tan \left (f x +e \right )}+\left (\frac {B}{16}+\frac {i A}{8}\right ) \ln \left (i+\tan \left (f x +e \right )\right )}{f \,a^{3} c}\) | \(128\) |
risch | \(-\frac {i x B}{8 a^{3} c}+\frac {x A}{4 a^{3} c}-\frac {{\mathrm e}^{-4 i \left (f x +e \right )} B}{32 a^{3} c f}+\frac {i {\mathrm e}^{-4 i \left (f x +e \right )} A}{16 a^{3} c f}-\frac {{\mathrm e}^{-6 i \left (f x +e \right )} B}{96 a^{3} c f}+\frac {i {\mathrm e}^{-6 i \left (f x +e \right )} A}{96 a^{3} c f}-\frac {\cos \left (2 f x +2 e \right ) B}{32 a^{3} c f}+\frac {5 i \cos \left (2 f x +2 e \right ) A}{32 a^{3} c f}-\frac {i \sin \left (2 f x +2 e \right ) B}{32 a^{3} c f}+\frac {7 \sin \left (2 f x +2 e \right ) A}{32 a^{3} c f}\) | \(195\) |
norman | \(\frac {\frac {\left (-i B +2 A \right ) x}{8 a c}-\frac {-4 i A +B}{12 a c f}+\frac {B \left (\tan ^{2}\left (f x +e \right )\right )}{4 a c f}+\frac {\left (-i B +2 A \right ) \left (\tan ^{3}\left (f x +e \right )\right )}{3 a c f}+\frac {\left (-i B +2 A \right ) \left (\tan ^{5}\left (f x +e \right )\right )}{8 a c f}+\frac {3 \left (-i B +2 A \right ) x \left (\tan ^{2}\left (f x +e \right )\right )}{8 a c}+\frac {3 \left (-i B +2 A \right ) x \left (\tan ^{4}\left (f x +e \right )\right )}{8 a c}+\frac {\left (-i B +2 A \right ) x \left (\tan ^{6}\left (f x +e \right )\right )}{8 a c}+\frac {\left (i B +6 A \right ) \tan \left (f x +e \right )}{8 a c f}}{\left (1+\tan ^{2}\left (f x +e \right )\right )^{3} a^{2}}\) | \(226\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: RuntimeError} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 6.83, size = 96, normalized size = 0.63 \begin {gather*} \frac {{\left (12 \, {\left (2 \, A - i \, B\right )} f x e^{\left (6 i \, f x + 6 i \, e\right )} - 3 \, {\left (i \, A + B\right )} e^{\left (8 i \, f x + 8 i \, e\right )} + 18 i \, A e^{\left (4 i \, f x + 4 i \, e\right )} - 3 \, {\left (-2 i \, A + B\right )} e^{\left (2 i \, f x + 2 i \, e\right )} + i \, A - B\right )} e^{\left (-6 i \, f x - 6 i \, e\right )}}{96 \, a^{3} c f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A]
time = 0.36, size = 340, normalized size = 2.22 \begin {gather*} \begin {cases} \frac {\left (294912 i A a^{9} c^{3} f^{3} e^{10 i e} e^{- 2 i f x} + \left (16384 i A a^{9} c^{3} f^{3} e^{6 i e} - 16384 B a^{9} c^{3} f^{3} e^{6 i e}\right ) e^{- 6 i f x} + \left (98304 i A a^{9} c^{3} f^{3} e^{8 i e} - 49152 B a^{9} c^{3} f^{3} e^{8 i e}\right ) e^{- 4 i f x} + \left (- 49152 i A a^{9} c^{3} f^{3} e^{14 i e} - 49152 B a^{9} c^{3} f^{3} e^{14 i e}\right ) e^{2 i f x}\right ) e^{- 12 i e}}{1572864 a^{12} c^{4} f^{4}} & \text {for}\: a^{12} c^{4} f^{4} e^{12 i e} \neq 0 \\x \left (- \frac {2 A - i B}{8 a^{3} c} + \frac {\left (A e^{8 i e} + 4 A e^{6 i e} + 6 A e^{4 i e} + 4 A e^{2 i e} + A - i B e^{8 i e} - 2 i B e^{6 i e} + 2 i B e^{2 i e} + i B\right ) e^{- 6 i e}}{16 a^{3} c}\right ) & \text {otherwise} \end {cases} + \frac {x \left (2 A - i B\right )}{8 a^{3} c} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.78, size = 192, normalized size = 1.25 \begin {gather*} -\frac {\frac {6 \, {\left (-2 i \, A - B\right )} \log \left (\tan \left (f x + e\right ) + i\right )}{a^{3} c} + \frac {6 \, {\left (2 i \, A + B\right )} \log \left (\tan \left (f x + e\right ) - i\right )}{a^{3} c} + \frac {6 \, {\left (2 i \, A \tan \left (f x + e\right ) + B \tan \left (f x + e\right ) - 3 \, A + 2 i \, B\right )}}{a^{3} c {\left (\tan \left (f x + e\right ) + i\right )}} + \frac {-22 i \, A \tan \left (f x + e\right )^{3} - 11 \, B \tan \left (f x + e\right )^{3} - 84 \, A \tan \left (f x + e\right )^{2} + 39 i \, B \tan \left (f x + e\right )^{2} + 114 i \, A \tan \left (f x + e\right ) + 45 \, B \tan \left (f x + e\right ) + 60 \, A - 9 i \, B}{a^{3} c {\left (\tan \left (f x + e\right ) - i\right )}^{3}}}{96 \, f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 9.06, size = 161, normalized size = 1.05 \begin {gather*} \frac {\frac {A}{3\,a^3\,c}+{\mathrm {tan}\left (e+f\,x\right )}^2\,\left (\frac {A}{2\,a^3\,c}-\frac {B\,1{}\mathrm {i}}{4\,a^3\,c}\right )+{\mathrm {tan}\left (e+f\,x\right )}^3\,\left (\frac {B}{8\,a^3\,c}+\frac {A\,1{}\mathrm {i}}{4\,a^3\,c}\right )-\mathrm {tan}\left (e+f\,x\right )\,\left (\frac {B}{24\,a^3\,c}+\frac {A\,1{}\mathrm {i}}{12\,a^3\,c}\right )+\frac {B\,1{}\mathrm {i}}{12\,a^3\,c}}{f\,\left ({\mathrm {tan}\left (e+f\,x\right )}^4\,1{}\mathrm {i}+2\,{\mathrm {tan}\left (e+f\,x\right )}^3+2\,\mathrm {tan}\left (e+f\,x\right )-\mathrm {i}\right )}-\frac {x\,\left (B+A\,2{}\mathrm {i}\right )\,1{}\mathrm {i}}{8\,a^3\,c} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________